<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
	var selMonth;
	function validateEditDate(type) {
		if(!selMonth || '' == $.trim(selMonth)) {
			$.messager.alert('提示','获取月份失败！'); 
		} else {
			if('end' == type) {
				var startDateValue = $("#company-task-edit-startDate").val();
				if('' == startDateValue) {
					$.messager.alert('提示','请选择开始日期！'); 
					document.getElementById("company-task-edit-startDate").focus();
					return false;
				}
			}
			var year = selMonth.substring(0, selMonth.indexOf("-"));
			var month = selMonth.substring(selMonth.indexOf("-") + 1);
			var first_date = new Date(year,month,1);
			var last_date = (new Date(first_date.getTime()-1000*60*60*24)).getDate();
			return selMonth + "-" + last_date;
		}
	}
</script>
<div style="padding-top: 10px; padding-left: 20px">
	<form id="company-datareport-task-edit">
		<span>开始日期：<input type="text" id="company-task-edit-startDate" name="startDate" style="width:100px" class="easyui-validatebox" data-options="required:true" onFocus="var createmonth=validateEditDate('start');WdatePicker({isShowClear:false,dateFmt:'yyyy-MM-dd', minDate:'#F{selMonth+\'-01\'}', maxDate:createmonth})" readonly> </span>&nbsp;&nbsp; 
		<span>结束日期：<input type="text" id="company-task-edit-endDate" name="endDate" style="width:100px" class="easyui-validatebox" data-options="required:true" onFocus="var createmonth=validateEditDate('end');WdatePicker({isShowClear:false,dateFmt:'yyyy-MM-dd', minDate:'#F{$dp.$D(\'company-task-edit-startDate\')}', maxDate:createmonth})" readonly> </span>&nbsp;&nbsp; 
	</form>
</div>